/**
 * Created by Administrator on 2017/11/21 0021.
 */
var yhydomain =" http://buz.payment.com/";
//验证码倒计时
function setTime($btn){
    var time = 60;
    var setTime = setInterval(function(){
        if(time<=0){
            $btn.removeClass("disabled").text("发送验证码");
            $btn.attr("disabled",false);
            clearInterval(setTime);
        }else{
            $btn.attr("disabled",true);
            $btn.addClass("disabled").text("重新发送" + time + "");
            time--;
        }
    },1000);
}
//发送验证码
function sendcode(phone,type){
    $.ajax({
        url: "/api/tool/sms",
        data: { to: phone, type: type},
        type: 'post',
        success:function(data){

            if(data.code == 0){
                alert("发送成功");
            }else {
                alert(data.message);
            }

        }
    });
}
//警告，提示弹窗
function showMsg(txt){
    $("#errorModel").modal("toggle");
    $("#errorModel .modal-body").find(".text-center").html(txt);
}
